#include "NeuronType.hh"

IzhikevichNeuronType::IzhikevichNeuronType(std::string name, int num_params, float* params) 
{
  _type = "Izhikevich";

  _name = name;
  _num_params = num_params;

  _params = new float[num_params];
  for(int i = 0; i < num_params; i++)
    _params[i] = params[i];
  
  // set default weight range
  _min_out_weight = 0.0;
  _max_out_weight = 1.0;
}

IzhikevichNeuronType::~IzhikevichNeuronType(void)
{
  delete _params;
}

float IzhikevichNeuronType::generateOutboundWeight(void)
{
  float weight = ( 
		 ((float)rand()/RAND_MAX) *  
		 (_max_out_weight - _min_out_weight)
		  )
    + _min_out_weight;

  return weight;
}

void IzhikevichNeuronType::setWeights(float min, float max)
{
  _min_out_weight = min;
  _max_out_weight = max;
}
